package space.sakana.edusysback.mapper.cls;

import org.apache.ibatis.annotations.*;
import space.sakana.edusysback.entity.cls.Cls;

import java.util.List;

@Mapper
public interface ClsMapper {

    @Select("select `id`, `name`, `create` from class where `id`=#{id};")
    Cls selectClsById(int id);

    @Select("select `id`, `name`, `create` from class;")
    List<Cls> selectAllCls();

    @Insert("insert into class(`name`, `create`) values(#{name}, #{create});")
    int insertCls(Cls cls);

    @Update("update class set `name`=#{name}, `create`=#{create} where `id`=#{id};")
    int updateCls(Cls cls);

    @Delete("delete from class where `id`=#{cid}")
    int deleteClsById(int cid);
}
